package com.czp.ssm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.czp.ssm.bean.Company;
import com.czp.ssm.bean.CompanyExample;
import com.czp.ssm.dao.CompanyMapper;
import com.czp.ssm.service.CompanyService;
@Service
public class CompanyServiceImpl implements CompanyService{

	@Autowired
	private CompanyMapper companyMapper;
	public Company findCompanyByCompanyId(String companyId) {
		Company company = companyMapper.selectByCompany(companyId);
		return company;
	}
	public List<Company> findAllCompanyList() {
		CompanyExample example = new CompanyExample();
		example.setOrderByClause("ID asc");
		example.setDistinct(true);
		List<Company> companieList = companyMapper.selectByExample(example);
		return companieList;
	}
	public Company findCompanyById(long id) {
		Company company = companyMapper.selectByPrimaryKey(id);
		
		return company;
	}

}
